package com.green.service.common;

import com.green.model.manage.Person;

/**
 * 服务上下文
 * 
 * @author fengwenjin
 *
 */
public  class  ServiceContext {
	
	private static final ThreadLocal<Person> personLocal = new ThreadLocal<Person>();
	private static final ThreadLocal<String> requestIPLocal = new ThreadLocal<String>();
	
	public static void setLoginPerson(Person person){
		personLocal.set(person);
	}
	
	public static Person getLoginPerson(){
		return personLocal.get();
	}
	
	public static void setRequestIP(String ip){
		requestIPLocal.set(ip);
	}
	
	public static String getRequestIP(){
		return requestIPLocal.get();
	}

}
